package com.letfox.test.example;

import java.util.Date;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.letfox.common.util.UUIDHexGenerator;
import com.letfox.finance.dao.AccountRlInoutDao;
import com.letfox.finance.dao.AccountRlNoviceDao;
import com.letfox.finance.dao.NoviceRlInoutDao;
import com.letfox.finance.enums.FINDelEnums;
import com.letfox.finance.enums.FINInoutTypeEnums;
import com.letfox.finance.model.FINAccountRlInout;
import com.letfox.finance.model.FINAccountRlNovice;
import com.letfox.finance.model.FINNoviceRlInout;
import com.letfox.test.util.MyBatisUtil;

public class AccountRlNoviceExample {

	private AccountRlNoviceDao  accountRlNoviceDao;
	
	@Test
	public void add(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		FINAccountRlNovice finAccountRlNovice = new FINAccountRlNovice();
		finAccountRlNovice.setId(123L);
		finAccountRlNovice.setFinNoviceId("40289a81628ac80401628ac8041b0000");
		finAccountRlNovice.setFinAccountId("40289a816289660f016289660f3b0000");
		finAccountRlNovice.setCreateTime(new Date());
		finAccountRlNovice.setUpdateTime(new Date());
		finAccountRlNovice.setCreateBy("admin");
		finAccountRlNovice.setUpdateBy("admin");
		finAccountRlNovice.setDel(FINDelEnums.UDMDel.EFFECTIVE.getValue());
		accountRlNoviceDao = session.getMapper(AccountRlNoviceDao.class);
		accountRlNoviceDao.insertSelective(finAccountRlNovice);
	}
	
	@Test
	public void update(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		FINAccountRlNovice finAccountRlNovice = new FINAccountRlNovice();
		finAccountRlNovice.setDel(FINDelEnums.UDMDel.DELETE.getValue());
		accountRlNoviceDao = session.getMapper(AccountRlNoviceDao.class);
		accountRlNoviceDao.updateByPrimaryKeySelective(finAccountRlNovice);
	}
	
	@Test
	public void select(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		accountRlNoviceDao = session.getMapper(AccountRlNoviceDao.class);

		FINAccountRlNovice finAccountRlNovice = accountRlNoviceDao.selectByPrimaryKey(123L);
		System.out.println(finAccountRlNovice.toString());
	}

}
